package com.example.test_01;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

import com.example.test_01.activity.Login;
import com.example.test_01.activity.Regist;

import org.litepal.LitePal;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    private static final String TAG = "MAIN";
    private Button BtnRegist;
    private Button BtnLogin;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        LitePal.initialize(this);
        BtnRegist = findViewById(R.id.btn_regist);
        BtnRegist.setOnClickListener(this);
        BtnLogin = findViewById(R.id.btn_login);
        BtnLogin.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.btn_login:
                {
                    Intent intent = new Intent(this, Login.class);
                    startActivity(intent);
                    Log.d(TAG, "onClick: 首页登录");
                };
                break;

            case R.id.btn_regist:{
                Log.d(TAG, "onClick: 首页注册");
                Intent intent = new Intent(this, Regist.class);
                startActivity(intent);
            }
        }
    }
}